<html><head></head>
<body background="../img/noa.jpg">
<?php
$dia=$_POST['day'];
$mes=$_POST['month'];
$yea=$_POST['year'];
$con= mysql_connect('localhost','root','');
mysql_select_db('spa_medico');
$conUsu = mysql_query("SELECT * FROM reserva r left join horario h on r.hora=h.cod_horario left join tratamiento t on r.cod_tratamiento = t.cod_tratamiento where r.fecha='$yea-$mes-$dia'");

?>
<h1 align="center"><?php echo("Reservas del: ".$dia."-".$mes."-".$yea); ?></h1>
<form name="formulario" action="cambia_reserva.php" method="post">
<table border="1" bgcolor="#95A2D5">
<tr ><td><h3 align="center">Hora</h3></td><td><h3 align="center">Paciente</h3></td><td><h3 align="center">Tratamiento</h3></td><td><h3 align="center">Asistencia</h3></td></tr>
<?php 
while ($resUsu = mysql_fetch_array($conUsu)){
		echo ("<tr><td>".$resUsu['descripcion']."</td>");
		echo ("<td>".$resUsu['cod_paciente']."</td>");
		echo ("<td>".$resUsu['desctrata']."</td>");
		if($resUsu['asistencia']!=1)
		{
			?>
       		<td>
	        <select name="fcodt">
          		<option value="0" selected>Elija Tratamiento</option>
			    <optgroup label="Trat. Corporal:">
	            <option value="t004">Fis. pre–post operatoria</option>
    			<option value="t005">Fisioterapia</option>
        		<option value="t001">Fis. Descontracturante</option>
	            <option value="s004">Reafirmación glúteos</option>
	            <option value="s005">Reafirmación senos</option>
        		<option value="t007">Antiestrías</option>
	            <option value="s007">Fortalecimiento Muscular</option>
        		<option value="t008">Lipocavitación</option>
        		<option value="t009">Mesoterapia</option>
                <optgroup label="&nbsp;&nbsp;&nbsp;&nbsp;Adelgazamiento Corporal">
	            <option value="s001">Geles</option>
	            <option value="s002">Masajes</option>
	            <option value="s003">Endermo</option>
                </optgroup>
                <optgroup label="&nbsp;&nbsp;&nbsp;&nbsp;Anticelulítico">
                <option value="t003">Drenaje</option>
	            <option value="s003">Endermo</option>
	            <option value="s008">Presoterapia</option>
                </optgroup>
                <optgroup label="&nbsp;&nbsp;&nbsp;&nbsp;Modelado Corporal">
                <option value="r002">Crioterapia</option>
	            <option value="s002">Masaje</option>
	            <option value="s004">Electroterapia</option>                            
                </optgroup>
                <optgroup label="&nbsp;&nbsp;&nbsp;&nbsp;Flacidez post parto">
                <option value="r001">R F T</option>
                <option value="t006">Colageno</option>
	            <option value="s004">Electroterapia</option>
                <option value="r003">Vendas Frias</option>
                <option value="r002">Crioterapia</option>
                </optgroup>
                </optgroup>
            	<optgroup label="Trat. Facial:">
           		<option value="t010">Limpieza facial</option>
		        <option value="t011">Trat. piel grasa</option>
   			    <option value="t012">Trat. piel seca</option>
          		<option value="t013">Trat. piel mixta</option>
		        <option value="t014">Hiperpigmentación Facial</option>
   			    <option value="t015">Trat. Antiage</option>
          		<option value="t016">Trat. Acné </option>
		        <option value="t017">Trat. Secuelas Acne</option>
   			    <option value="t018">Microdermoabrasión</option>
   			    <option value="t019">Choco ó Fango-terapia Facial</option>
          		<option value="r004">Velo de Colágeno</option>
		        <option value="r005">Radiofrecuencia Tripolar</option>
		        <option value="r006">Toxina Botulínica Tipo A</option>
            	</optgroup>
	            <optgroup label="Trat. Alternatovos:">
           		<option value="t020">Relajacion Corporal</option>
           		<option value="r007">Hidroterapia</option>
		        <option value="r008">Sauna</option>
		        <option value="r009">Reflexología</option>
		        <option value="u001">Choco ó Fango-terapia Corporal</option>
   			    <option value="t021">Hidratación corporal con aceites</option>
                </optgroup>
           	</select><br>
        	<select name="day">
           		<option value="0">Dia:</option>
                <?php 
				for($i=1;$i<=31;$i++)
				echo "<option>".$i."</option>";						
				?>
                </select>
 	            <select name="month">
           		<option value="0">Mes</option>
                <?php 
				for($i=1;$i<=12;$i++)
				echo "<option>".$i."</option>";						
				?>
		        </select>
       		    <select name="year">
    	        <option value="0">Año:</option>
                <?php 
				for($i=2012;$i<=2030;$i++)
				echo "<option>".$i."</option>";						
				?>        
  			    </select><br>
        	<input name="fcodp" type="text" value="Cod. Paciente" / ><input type="submit" value="OK"/></td>
        <?php 
		}
		else
		{
			echo ("<td>Asistio</td>");
		}
		
}
?>
</table>
<?php 
@@mysql_free_result($conUsu);
@@mysql_close($conexion);
?>
</body>
</html>